<?php

namespace App\Models;

use Encore\Admin\Traits\DefaultDatetimeFormat;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;

class Site extends Model
{
    use DefaultDatetimeFormat;

    protected $fillable = ['name', 'prefix', 'logo', 'icon', 'enabled'];

    public static function allCollection(): Collection
    {
        return Cache::rememberForever('site_all_collection_cache112', function () {
            return self::query()->orderBy('order')->get();
        });
    }
    public static function forgetCache()
    {
        Cache::forget('site_all_collection_cache112');
    }

}
